package com.wanxi.product.service.api.feign;

import com.wanxi.product.service.api.result.CommonResult;
import com.wanxi.product.service.api.vo.admin.*;
import com.wanxi.product.service.api.query.admin.SkuQuery;
import com.wanxi.product.service.api.query.admin.TagQuery;
import com.wanxi.product.service.api.query.admin.TypeQuery;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(name = "product-server")
@RequestMapping("/admin")
public interface ProductAdminService {
    /**
     * 添加分类
     * @param typeAddInVo
     * @return
     */
    @PostMapping("/type/add")
    CommonResult<Long> addType(@RequestBody TypeAddInVo typeAddInVo);

    /**
     * 获取分类列表
     * @param firstTypeQuery
     * @return
     */
    @GetMapping("/type/findAll")
    CommonResult<List<TypeFindAllOutVo>> findAllType(@RequestBody TypeQuery firstTypeQuery);

    /**
     * 根据id查询分类
     * @param typeId
     * @return
     */
    @GetMapping("/type/findById")
    CommonResult<TypeFindByIdOutVo> findTypeById(@RequestParam(name = "id") Long typeId);

    /**
     * 修改分类
     * @param typeUpdateInVo
     * @return
     */
    @PutMapping("/type/update")
    CommonResult updateType(@RequestBody TypeUpdateInVo typeUpdateInVo);

    /**
     * 删除分类
     * @param typeId
     * @return
     */
    @PutMapping("/type/delete")
    CommonResult deleteType(@RequestParam(name = "id") Long typeId);

    /**
     * 获取sku列表
     * @param skuQuery
     * @return
     */
    @GetMapping("/sku/findAll")
    CommonResult<List<SkuFindAllOutVo>> findAllSku(@RequestBody  SkuQuery skuQuery);

    /**
     * 修改sku
     * @param skuUpdateInVo
     * @return
     */
    @PutMapping("/sku/update")
    CommonResult updateSku(@RequestBody SkuUpdateInVo skuUpdateInVo);

    /**
     * 删除sku
     * @param skuId
     * @return
     */
    @PutMapping("/sku/delete")
    CommonResult deleteSkuById(@RequestParam(name = "skuId") Long skuId);

    /**
     * 添加标签
     * @param tagAddInVo
     * @return
     */
    @PostMapping("/tag/add")
    CommonResult addTag(@RequestBody TagAddInVo tagAddInVo);

    /**
     * 获取标签列表
     * @param tagQuery
     * @return
     */
    @GetMapping("/tag/findAll")
    CommonResult<List<TagFindAllOutVo>> findTagAll(@SpringQueryMap TagQuery tagQuery);

    /**
     * 逻辑删除标签
     * @param tagId
     * @return
     */
    @PutMapping("/tag/delete")
    CommonResult deleteTagById(@RequestParam(name = "tagId") Long tagId);
}
